<?php

/**
 * EmailCampaignUserPerformance filter form base class.
 *
 * @package    ecrm
 * @subpackage filter
 * @author     Saul Santiago
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BaseEmailCampaignUserPerformanceFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'email_campaign_user_details_id' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('EmailCampaignUserDetails'), 'add_empty' => true)),
      'selected'                       => new sfWidgetFormChoice(array('choices' => array('' => '', 'Yes' => 'Yes', 'No' => 'No'))),
      'hard_bounce'                    => new sfWidgetFormChoice(array('choices' => array('' => '', 'Yes' => 'Yes', 'No' => 'No'))),
      'soft_bounce'                    => new sfWidgetFormChoice(array('choices' => array('' => '', 'Yes' => 'Yes', 'No' => 'No'))),
      'received'                       => new sfWidgetFormChoice(array('choices' => array('' => '', 'Yes' => 'Yes', 'No' => 'No'))),
      'opened'                         => new sfWidgetFormChoice(array('choices' => array('' => '', 'Yes' => 'Yes', 'No' => 'No'))),
      'clicked'                        => new sfWidgetFormChoice(array('choices' => array('' => '', 'Yes' => 'Yes', 'No' => 'No'))),
      'unsubscribed'                   => new sfWidgetFormChoice(array('choices' => array('' => '', 'Yes' => 'Yes', 'No' => 'No'))),
      'complaint'                      => new sfWidgetFormChoice(array('choices' => array('' => '', 'Yes' => 'Yes', 'No' => 'No'))),
    ));

    $this->setValidators(array(
      'email_campaign_user_details_id' => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('EmailCampaignUserDetails'), 'column' => 'id')),
      'selected'                       => new sfValidatorChoice(array('required' => false, 'choices' => array('Yes' => 'Yes', 'No' => 'No'))),
      'hard_bounce'                    => new sfValidatorChoice(array('required' => false, 'choices' => array('Yes' => 'Yes', 'No' => 'No'))),
      'soft_bounce'                    => new sfValidatorChoice(array('required' => false, 'choices' => array('Yes' => 'Yes', 'No' => 'No'))),
      'received'                       => new sfValidatorChoice(array('required' => false, 'choices' => array('Yes' => 'Yes', 'No' => 'No'))),
      'opened'                         => new sfValidatorChoice(array('required' => false, 'choices' => array('Yes' => 'Yes', 'No' => 'No'))),
      'clicked'                        => new sfValidatorChoice(array('required' => false, 'choices' => array('Yes' => 'Yes', 'No' => 'No'))),
      'unsubscribed'                   => new sfValidatorChoice(array('required' => false, 'choices' => array('Yes' => 'Yes', 'No' => 'No'))),
      'complaint'                      => new sfValidatorChoice(array('required' => false, 'choices' => array('Yes' => 'Yes', 'No' => 'No'))),
    ));

    $this->widgetSchema->setNameFormat('email_campaign_user_performance_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'EmailCampaignUserPerformance';
  }

  public function getFields()
  {
    return array(
      'id'                             => 'Number',
      'email_campaign_user_details_id' => 'ForeignKey',
      'selected'                       => 'Enum',
      'hard_bounce'                    => 'Enum',
      'soft_bounce'                    => 'Enum',
      'received'                       => 'Enum',
      'opened'                         => 'Enum',
      'clicked'                        => 'Enum',
      'unsubscribed'                   => 'Enum',
      'complaint'                      => 'Enum',
    );
  }
}
